﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FytSoa.Core.Model.Sw
{
    ///<summary>
    ///商城-商品表 
    ///</summary>
    public partial class Sw_goods
    {
        public Sw_goods()
        {


        }
        /// <summary>
        /// Desc:唯一编号
        /// Default:
        /// Nullable:False
        /// </summary>           
        public string Guid { get; set; }

        /// <summary>
        /// Desc:商品编号
        /// Default:
        /// Nullable:False
        /// </summary>           
        public string Number { get; set; }

        /// <summary>
        /// Desc:商品名称
        /// Default:
        /// Nullable:False
        /// </summary>           
        public string GoodsName { get; set; }

        /// <summary>
        /// Desc:所属商家
        /// Default:
        /// Nullable:False
        /// </summary>           
        public string StoreGuid { get; set; }

        /// <summary>
        /// Desc:所属分类 可多个
        /// Default:
        /// Nullable:False
        /// </summary>           
        public int ColumnGuid { get; set; } = 0;

        /// <summary>
        /// Desc:所属父分类集合
        /// Default:
        /// Nullable:False
        /// </summary>           
        public string ColumnParentGuid { get; set; }

        /// <summary>
        /// Desc:所属品牌
        /// Default:
        /// Nullable:False
        /// </summary>           
        public string BrandGuid { get; set; }

        /// <summary>
        /// Desc:商品封面图
        /// Default:
        /// Nullable:False
        /// </summary>           
        public string Cover { get; set; }

        /// <summary>
        /// Desc:商品宣传图
        /// Default:
        /// Nullable:True
        /// </summary>
        [SugarColumn(IsJson = true)]
        public List<SwGoodsImageJson> ImageList { get; set; }=new List<SwGoodsImageJson>();

        /// <summary>
        /// Desc:商品副标题 促销信息
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string SubTitle { get; set; }

        /// <summary>
        /// Desc:商品成本
        /// Default:0.00
        /// Nullable:False
        /// </summary>           
        public decimal CostPrice { get; set; } = 0;

        /// <summary>
        /// Desc:商品原价格
        /// Default:0.00
        /// Nullable:False
        /// </summary>           
        public decimal OriginalPrice { get; set; } = 0;

        /// <summary>
        /// Desc:销售价格
        /// Default:0.00
        /// Nullable:False
        /// </summary>           
        public decimal SalePrice { get; set; } = 0;

        /// <summary>
        /// Desc:收货方式 商家自提、快递
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string GetGoodsType { get; set; }

        /// <summary>
        /// Desc:计量单位
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string Unit { get; set; }

        /// <summary>
        /// Desc:标签
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string Tags { get; set; }

        /// <summary>
        /// Desc:是否推荐
        /// Default:0
        /// Nullable:False
        /// </summary>           
        public bool IsTop { get; set; } = false;

        /// <summary>
        /// Desc:是否热销
        /// Default:0
        /// Nullable:False
        /// </summary>           
        public bool IsRed { get; set; } = false;

        /// <summary>
        /// Desc:是否上架
        /// Default:1
        /// Nullable:False
        /// </summary>           
        public bool IsAudit { get; set; } = true;

        /// <summary>
        /// Desc:上架时间
        /// Default:
        /// Nullable:True
        /// </summary>           
        public DateTime? BeginTime { get; set; }

        /// <summary>
        /// Desc:下架时间
        /// Default:
        /// Nullable:True
        /// </summary>           
        public DateTime? EndTime { get; set; }

        /// <summary>
        /// Desc:是否参与会员折扣
        /// Default:0
        /// Nullable:False
        /// </summary>           
        public bool IsDisCount { get; set; } = false;

        /// <summary>
        /// Desc:会员折扣类型(true=默认配置的会员折扣false=自定义的会员折扣)
        /// Default:0
        /// Nullable:False
        /// </summary>           
        public bool DisCountType { get; set; } = true;

        /// <summary>
        /// Desc:自定义的会员折扣
        /// Default:0
        /// Nullable:False
        /// </summary> 
        [SugarColumn(IsJson = true)]
        public List<SwGoodsDisCountJson> DisCountJson { get; set; }

        /// <summary>
        /// Desc:是否包邮
        /// Default:0
        /// Nullable:False
        /// </summary>           
        public bool IsDelivery { get; set; } = false;

        /// <summary>
        /// Desc:运费
        /// Default:0.00
        /// Nullable:False
        /// </summary>           
        public decimal Freight { get; set; } = 0;

        /// <summary>
        /// Desc:是否支持退换货
        /// Default:1
        /// Nullable:False
        /// </summary>           
        public bool IsReturn { get; set; } = true;

        /// <summary>
        /// Desc:是否支持使用优惠券
        /// Default:1
        /// Nullable:False
        /// </summary>           
        public bool IsCoupon { get; set; } = true;

        /// <summary>
        /// Desc:是否参与分销
        /// Default:0
        /// Nullable:False
        /// </summary>           
        public bool IsFenXiao { get; set; } = false;

        /// <summary>
        /// Desc:分销级别对应金额设置 Json(分销等级，对应金额)
        /// Default:
        /// Nullable:True
        /// </summary>      
        [SugarColumn(IsJson = true)]
        public List<SwGoodsRetailJson> FenXiaoJson { get; set; }

        /// <summary>
        /// Desc:是否删除 删除后在回收站
        /// Default:0
        /// Nullable:False
        /// </summary>           
        public bool IsDel { get; set; } = false;

        /// <summary>
        /// Desc:服务范围 Json(正品保证、七天无理由退货、保修)
        /// Default:
        /// Nullable:True
        /// </summary>    
        [SugarColumn(IsJson = true)]
        public List<SwGoodsServerJson> ServerJson { get; set; } = new List<SwGoodsServerJson>
                {
                    new SwGoodsServerJson()
                    {
                        name = "正品保证",
                        status = true
                    },
                    new SwGoodsServerJson()
                    {
                        name = "市区包邮",
                        status = false
                    },
                    new SwGoodsServerJson()
                    {
                        name = "保修",
                        status = false
                    }
                };

        /// <summary>
        /// Desc:赠送积分
        /// Default:0
        /// Nullable:False
        /// </summary>           
        public int GiftPoints { get; set; } = 0;

        /// <summary>
        /// Desc:库存数
        /// Default:0
        /// Nullable:False
        /// </summary>           
        public int KcSum { get; set; } = 0;

        /// <summary>
        /// Desc:销售数
        /// Default:0
        /// Nullable:False
        /// </summary>           
        public int XsSum { get; set; } = 0;

        /// <summary>
        /// Desc:查看数
        /// Default:0
        /// Nullable:False
        /// </summary>           
        public int Hits { get; set; } = 0;

        /// <summary>
        /// Desc:是否开启规格
        /// Default:0
        /// Nullable:False
        /// </summary>           
        public bool IsOpenSpect { get; set; } = false;

        /// <summary>
        /// Desc:商品规格 Json(货号，选择项、库存数、价格、销售价格，默认规格)
        /// Default:
        /// Nullable:True
        /// </summary> 
        [SugarColumn(IsJson = true)]
        public List<SwGoodsSpectJson> SpectJson { get; set; } = new List<SwGoodsSpectJson>();

        /// <summary>
        /// Desc:商品规格栏位 Json(guid，name、enname)
        /// Default:
        /// Nullable:True
        /// </summary> 
        [SugarColumn(IsJson = true)]
        public List<SwGoodsSelectSpectJson> SpectColumnJson { get; set; } = new List<SwGoodsSelectSpectJson>();

        /// <summary>
        /// Desc:是否开启积分兑换
        /// Default:0
        /// Nullable:False
        /// </summary>           
        public bool IsExchange { get; set; } = false;

        /// <summary>
        /// Desc:兑换积分数
        /// Default:0
        /// Nullable:False
        /// </summary>           
        public int ExchangePoint { get; set; } = 0;

        /// <summary>
        /// Desc:包装清单
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string PackInfo { get; set; }

        /// <summary>
        /// Desc:商品关键字
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string Keyword { get; set; }

        /// <summary>
        /// Desc:商品描述
        /// Default:
        /// Nullable:True
        /// </summary>           
        public string Description { get; set; }

        /// <summary>
        /// Desc:商品内容
        /// Default:
        /// Nullable:False
        /// </summary>           
        public string Context { get; set; }

        /// <summary>
        /// Desc:排序
        /// Default:0
        /// Nullable:False
        /// </summary>           
        public int Sort { get; set; } = 1;

        /// <summary>
        /// Desc:修改时间
        /// Default:
        /// Nullable:False
        /// </summary>           
        public DateTime UpdateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// Desc:添加时间
        /// Default:
        /// Nullable:False
        /// </summary>           
        public DateTime AddTime { get; set; } = DateTime.Now;

    }

    /// <summary>
    /// 商品详细规格
    /// </summary>
    public class SwGoodsSpectJson
    {
        /// <summary>
        /// 编码
        /// </summary>
        public string number { get; set; }

        /// <summary>
        /// 库存
        /// </summary>
        public int kcsum { get; set; } = 0;

        /// <summary>
        /// 销售价格
        /// </summary>
        public decimal saleprice { get; set; } = 0;

        /// <summary>
        /// 原价格
        /// </summary>
        public decimal sourceprice { get; set; } = 0;

        /// <summary>
        /// 成本
        /// </summary>
        public decimal costprice { get; set; } = 0;

        /// <summary>
        /// 是否默认
        /// </summary>
        public bool isdefault { get; set; } = false;

        /// <summary>
        /// 条形码
        /// </summary>
        public string sku { get; set; }

        /// <summary>
        /// 自定义的规格
        /// </summary>
        public List<SwGoodsSelectSpectJson> spectValue { get; set; }
    }

    /// <summary>
    /// 所选规格-对应Sw_spect表
    /// </summary>
    public class SwGoodsSelectSpectJson
    {
        /// <summary>
        /// 规格栏目编号
        /// </summary>
        public string guid { get; set; }

        /// <summary>
        /// 规格栏目名称，如颜色
        /// </summary>
        public string name { get; set; }

        /// <summary>
        /// 规格栏目英文名称
        /// </summary>
        public string enname { get; set; }

        /// <summary>
        /// 提供给选择的使用，
        /// </summary>
        public string value { get; set; }
    }

    /// <summary>
    /// 商品图片列表
    /// </summary>
    public class SwGoodsImageJson
    {
        public string image { get; set; }
    }

    /// <summary>
    /// 商品服务内容
    /// </summary>
    public class SwGoodsServerJson
    {
        public string name { get; set; }

        public bool status { get; set; } = true;
    }

    /// <summary>
    /// 商品会员折扣内容
    /// </summary>
    public class SwGoodsDisCountJson
    {
        /// <summary>
        /// 组编号
        /// </summary>
        public string guid { get; set; }

        /// <summary>
        /// 组名称
        /// </summary>
        public string name { get; set; }

        /// <summary>
        /// 百分比
        /// </summary>
        public int ratio { get; set; } = 0;

        /// <summary>
        /// 具体会员金额
        /// </summary>
        public decimal money { get; set; } = 0;
    }

    /// <summary>
    /// 商品分销
    /// </summary>
    public class SwGoodsRetailJson
    {
        /// <summary>
        /// 级别
        /// </summary>
        public int level { get; set; } = 1;

        /// <summary>
        /// 名字
        /// </summary>
        public string name { get; set; }

        /// <summary>
        /// 百分比
        /// </summary>
        public int ratio { get; set; }=0;

        /// <summary>
        /// 具体分成
        /// </summary>
        public decimal money { get; set; } = 0;
    }
}
